

#import <NSMKit/NSMKit.h>

/** API类型,和服务器短信验证码类型对应 */
typedef NS_ENUM(NSInteger, ApiType) {
    ApiTypeRegist = 1,          // 注册
    ApiTypeForgot = 2,          // 忘记密码
    ApiTypeModifyLogin = 3,     // 修改登录密码
    ApiTypeModifyPay = 4,       // 修改支付密码
    ApiTypeBindOnAccount = 5    // 第三方账号绑定
};

/** 控件类型,和二进制maskCode对应 */
typedef NS_OPTIONS(NSInteger, ComponentOptions) {
    ComponentUsername           = 1 << 0,   // 用户名
    ComponentMobile             = 1 << 1,   // 电话号码
    ComponentSMSCode            = 1 << 2,   // 短信验证码
    ComponentPasswordOld        = 1 << 3,   // 旧密码
    ComponentPassword           = 1 << 4,   // 密码
    ComponentPasswordAgain      = 1 << 5,   // 密码确认
    ComponentNickname           = 1 << 6,   // 昵称
    ComponentInvitationCode     = 1 << 7,   // 邀请码
};

@interface RegistController : NSMViewController

@property (nonatomic) ApiType apiType;
@property (nonatomic) NSArray<NSNumber *> *components;
/** 用户名是否允许编辑, 默认YES */
@property (nonatomic) BOOL usernameEditEnabled;
/** 电话号码是否允许编辑, 默认YES */
@property (nonatomic) BOOL mobileEditEnabled;
@property (nonatomic, copy) void(^didSumitSuccess)(id obj);
@property (nonatomic, copy) NSString *inviteCode;

@end
